﻿using CTP.CRM.Repository.Enum;
using CTP.CRM.Repository.Setting.Entitys;

namespace CTP.CRM.Repository.Setting.Services
{
    public interface ISettingRepository : IScopedDependency
    {
        Task<int> UpsertSetting(IEnumerable<KeyValuePair<string, string>> keyValuePairs, int foreignId, SettingTypeEnum type);

        Task<int> DeleteSetting(IEnumerable<int> deleteIds);

        Task<List<SettingEntity>> GetSetting(int foreignId, SettingTypeEnum type);

        Task<T> GetSettingValueAsync<T>(int foreignId, SettingTypeEnum type, T instance = default);

        Task<List<T>> GetSettingValueListAsync<T>(List<int> foreignIdList, SettingTypeEnum type, T instance = default) where T : new();

        T GetSettingValue<T>(int foreignId, SettingTypeEnum type, T instance = default);
    }
}
